/**
 * 主体星级
 */
export const stars = [
  { code: '0', name: '无星' },
  { code: '1', name: '一星' },
  { code: '2', name: '二星' },
  { code: '3', name: '三星' },
  { code: '4', name: '四星' },
  { code: '5', name: '五星' }
];

export const starMap = stars.reduce((obj, item) => {
  obj[item.code] = item.name;
  return obj;
}, {});

/**
 * 会员卡类型
 */
export const cardTypes = [
  { code: 'Physical', name: '实体卡' },
  { code: 'Virtual', name: '虚拟卡' }
];

export const cardTypesMap = cardTypes.reduce((obj, item) => {
  obj[item.code] = item.name;
  return obj;
}, {});

/**
 * 会员卡状态
 */
export const memberCardStatus = [
  { code: 'Active', name: '激活' },
  { code: 'Lost', name: '挂失' },
  { code: 'Freeze', name: '冻结' },
  { code: 'Expired', name: '过期' },
  { code: 'InActive', name: '作废' }
];

export const memberCardStatusMap = memberCardStatus.reduce((obj, item) => {
  obj[item.code] = item.name;
  return obj;
}, {});

export const transactionTypes = [
  { code: 'REVENUE', name: '收入' },
  { code: 'PAYMENT', name: '付款' }
];

export const transactionTypesMap = transactionTypes.reduce((obj, item) => {
  obj[item.code] = item.name;
  return obj;
}, {});

export const AppParameterTypes = [
  { code: 'Platform', name: '系统级' },
  { code: 'Custom', name: '用户级' }
];

// 付款类型
export const paymentTypes = [
  { code: 'Cash', name: '现金' },
  { code: 'Check', name: '支票' },
  { code: 'CreditCard', name: '信用卡' },
  { code: 'Other', name: '其它' }
];

export const paymentTypesMap = paymentTypes.reduce((obj, item) => {
  obj[item.code] = item.name;
  return obj;
}, {});

export const paymentIcons = [
  { code: 'cash', name: '现金' },
  { code: 'yinlian', name: '银联支付' },
  { code: 'wechat', name: '微信支付' },
  { code: 'alipay', name: '支付宝' },
  { code: 'yunshanfu', name: '云闪付' },
  { code: 'shuzirenminbi', name: '数字人民币' },
  { code: 'ticket', name: '优惠券' },
  { code: 'zhipiao', name: '支票' },
  { code: 'ctrip', name: '携程支付' },
  { code: 'meituan', name: '美团支付' },
  { code: 'dazhongdianping', name: '大众点评' },
  { code: 'alibaba', name: '阿里巴巴支付' },
  { code: 'visa', name: 'VISA' },
  { code: 'amex', name: 'AMEX' },
  { code: 'jcb', name: 'JCB' },
  { code: 'master-card', name: 'Master Card' }
];

export const userTypes = [
  { code: 'Customer', name: '主体用户' },
  { code: 'Administrator', name: '平台用户' }
];

/**
 * 用户状态常量
 */
export const userStatuses = [
  { code: 'Active', name: '激活' },
  { code: 'InActive', name: '失效' },
  { code: 'Locked', name: '锁定' },
  { code: 'Terminated', name: '离职' }
];

export const userStatusesMap = userStatuses.reduce((obj, item) => {
  obj[item.code] = item.name;
  return obj;
}, {});
